1. Field of the Invention
This invention relates to packet processing. Specifically, the present invention relates to packet testing and validation.
2. Description of the Related Art
Communications networks have grown and developed over the past several years. Modern data communications networks are complaint with several communications protocols. The communications protocols set standards and provide specifications for compliance. For example, in a packet network a communication protocol would define the structure of packets (e.g. packet format) implementing the protocol and determine how the packets are communicated across a network.
In addition, the protocols define methods for routing and processing the packets. Since packets often include their source and destination address, communications protocols define how these addresses are formatted and how the addresses are used to forward the packets. However, although a protocol may define that a specific field may be used to format or process packets, these protocols don't often define how these processes should be implemented. This is often a task for the designer or manufacturer.
Therefore, it is common for communications protocols to define the format of a packet, but not define the process for testing or processing the packet. For example, packets communicated across a network have fields that often need to be compared with a range of fields. However, communications protocols don't often define exactly how these values should be compared or when during the packet processing that the value should be compared.
Packet lengths are often defined in a packet and often have to be compared with a range of values. For example, a port in a device may support a range of packet sizes. As a result, when a packet arrives at a port, the specific packet size encoded in the packet has to be compared with the range of packet sizes accepted by the port. The method for performing this comparison is not often defined by a communication protocol. However, single value to multiple value range comparison, is typically performed a number of times as a packet is processed through a network.
In addition, the method used to perform functions that are not defined by communications protocols, such as single value to multiple value range comparisons, may make a substantial difference in the performance of a system. Therefore, this specific aspect of packet processing has received some attention by designers.
A few conventional methods have been developed for performing range comparisons. In some implementations, the single value is compared with every value in the range. If the range is 16 values long, this would mean 16 comparisons. However, the speed of performing this type of comparison every time a comparison has to be made, on every packet, is slow. A second method would involve storing the upper limit of the range in a memory at every port and performing a simple test on the single value. However, this does not work when the range values are not incremental, in addition it requires additional memory to store the upper limit range value. Lastly, it is slow to implement in digital logic.
There is a need for an efficient method of making a single value to multiple value range comparison. There is a need for a method of implementing a range comparison that is fast compared with conventional methods. Lastly, there is a need for implementing a range comparison that uses simple digital logic.